Skip to content

gh-151096: Fix test_embed with split exec prefix#151288

Merged
vstinner merged 2 commits into
python:mainfrom
harjothkhara:gh-151096-test-embed-split-prefix
Jun 29, 2026
Merged

gh-151096: Fix test_embed with split exec prefix#151288
vstinner merged 2 commits into
python:mainfrom
harjothkhara:gh-151096-test-embed-split-prefix

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fix test_init_is_python_build_with_home for builds configured with different --prefix and --exec-prefix.

When running from the build directory on POSIX, getpath uses PREFIX for prefix/base_prefix and EXEC_PREFIX for exec_prefix/base_exec_prefix. The test assumed both match sys.prefix, which fails on a split-prefix build. This also fixes the module_search_paths() helper so its default exec_prefix comes from the expected config's exec_prefix rather than prefix.

Verified with a local split-prefix build (--prefix=… --exec-prefix=…/exec): the targeted test failed before and passes after, and full test_embed passes. Tests-only change.

Disclosure: AI-assisted; I've reviewed it.

@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jun 10, 2026
@harjothkhara harjothkhara marked this pull request as ready for review June 10, 2026 23:09
@harjothkhara

harjothkhara commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@vstinner, this is a small test-only fix in test_embed: this makes test_init_is_python_build_with_home pass with split --prefix / --exec-prefix builds. Would you mind taking a quick look?

@harjothkhara

Copy link
Copy Markdown
Contributor Author

@vstinner gentle nudge on this small test-only fix — it makes test_init_is_python_build_with_home pass with split --prefix/--exec-prefix builds (gh-151096). All green. Would you mind a quick look?

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix.

@vstinner vstinner merged commit b19839b into python:main Jun 29, 2026
55 checks passed
@vstinner vstinner added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 29, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @harjothkhara for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @harjothkhara for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

GH-152590 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 29, 2026
@bedevere-app

bedevere-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

GH-152591 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 29, 2026
@vstinner vstinner added the needs backport to 3.13 bugs and security fixes label Jun 29, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @harjothkhara for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

GH-152593 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jun 29, 2026
vstinner pushed a commit that referenced this pull request Jun 29, 2026
…152590)

gh-151096: Fix test_embed with split exec prefix (GH-151288)
(cherry picked from commit b19839b)

Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
vstinner pushed a commit that referenced this pull request Jun 29, 2026
…152593)

gh-151096: Fix test_embed with split exec prefix (GH-151288)
(cherry picked from commit b19839b)

Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
vstinner pushed a commit that referenced this pull request Jun 29, 2026
…152591)

gh-151096: Fix test_embed with split exec prefix (GH-151288)
(cherry picked from commit b19839b)

Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants